package me.boot.auth.jap.service;

import com.fujieid.jap.core.JapUser;
import com.fujieid.jap.core.JapUserService;
import me.boot.auth.jap.config.AuthProperties;
import org.springframework.beans.factory.annotation.Autowired;

public abstract class BaseJapUserServiceImpl implements JapUserService {

    @Autowired
    protected UserService userService;

    @Autowired
    protected AuthProperties authProperties;

    /**
     * 当启用 sso 功能时，该方法必须实现
     *
     * @param userId 用户id
     * @return JapUser
     */
    @Override
    public JapUser getById(String userId) {
        return userService.getById(userId);
    }

    @Override
    public JapUser getByName(String username) {
        return userService.getByUsername(username);
    }

    @Override
    public JapUser getByPlatformAndUid(String platform, String uid) {
        return userService.getByPlatformAndUid(platform, uid);
    }

    @Override
    public boolean validPassword(String password, JapUser user) {
        return userService.validPassword(password, user);
    }
}
